{% extends "base/base.html" %}
{% load asset_filter %}
{% load bootstrap3 %}
{% load  static %}
{% block header-css %}

    <style type="text/css">
        .sort_both_png {
            background: url('/static/img/sort_both.png') no-repeat right 1px center;
            cursor: pointer;
        }

        .sort_asc_png {
            background: url('/static/img/sort_asc.png') no-repeat right 1px center;
            cursor: pointer;
        }

        .sort_desc_png {
            background: url('/static/img/sort_desc.png') no-repeat right 1px center;
            cursor: pointer;
        }


    </style>



{% endblock %}

{% block  title %}K8S{% endblock %}



{% block page-content %}


    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-lg-12" id="split-right">

                <div class="ibox float-e-margins">

                    <div class="ibox-title">
                        <h5>Pod列表</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">



                        <div class="table-responsive">


                            <form class="form-horizontal  "
                                  method="post">
                                {% csrf_token %}
                                <table class="table table-striped table-bordered table-hover dataTables-example">
                                    <thead>
                                    <tr>


                                        <th>主机名</th>
                                        <th>ip</th>
                                        <th>命名空间</th>
                                          <th>详情</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {% for   k,v  in   data.items  %}

                                        <tr class="gradeA" id="{{ row.id }}" name="{{ k }}">


                                            <td class="center">
                                                <div class="">{{ k }}</div>
                                            </td>
                                            <td class="center">
                                                <div class="">{{ v.ip }}</div>
                                            </td>
                                            <td class="center">
                                                <div class="">{{ v.namespace}}</div>
                                            </td>
                                                                                        <td class="center">
                                                 <a class="btn btn-warning  btn-xs "  target="_blank"
                                                       href="{% url  "k8s:k8s-pod-detail" %}?namespace={{ v.namespace }}&name={{ k }}">详情</a>
                                            </td>

                                            <td class="center">
                                                 <a class="btn btn-success  btn-xs "  target="_blank"
                                                       href="{% url  "k8s:k8s-pod-webssh" %}?namespace={{ v.namespace }}&name={{ k }}">webssh</a>
                                            </td>

                                        </tr>
                                    {% endfor %}
                                    </tbody>

                                </table>

                            </form>


                        </div>

                    </div>


                </div>
            </div>
        </div>
    </div>





    {% block footer-js %}

        <script>
            window.onload = function () {   // 固定左边导航栏
                $(".k8s").addClass("active");
                $(".k8s-pod-list").addClass("active");
            };

        </script>
    {% endblock %}

{% endblock %}
